package com.siqi.hr.system.custom.dao.mysql;

import com.siqi.hr.system.custom.dao.intf.EntityTypeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 注册实体类型dao实现类层
 * @author    xiaogq
 * Created by xiaogoingqin on 2016/7/24.
 */
@Component("entityTypeDao")
public class EntityTypeDaoImpl implements EntityTypeDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public List<String> getEntityTypesByEntityId(String entityId) {
        StringBuffer sql = new StringBuffer("select id from sys_custom_entity_type where entity_id= ").append(entityId).append(" order by id ");
        List<String> typeList = jdbcTemplate.queryForList(sql.toString(), String.class);
        return typeList;
    }
}
